package org.baicaixiaozhan.emailmanager.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.baicaixiaozhan.emailmanager.vo.UserPermission;
import org.springframework.stereotype.Repository;

import java.util.Set;

/**
 * DESC:
 *
 * @author : baicaixiaozhan
 * @since : 2021-06-21
 */
@Repository
public interface UserPermissionDao {

    /**
     * 根据 username 查询 UserPermission
     *
     * @param username
     * @return {@link UserPermission}
     */
    @Select("select * from user_permission up inner join authorities a on up.authority = a.authority and a.username = #{username}")
    Set<UserPermission> findUserPermissionByUsername(@Param("username") String username);

}
